<%--
  Created by IntelliJ IDEA.
  User: zhuya
  Date: 2016/2/3
  Time: 13:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="privilege" uri="/WEB-INF/privilege.tld" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <title>线索举报详情</title>
  <link rel="stylesheet" href="<c:url value='/resource/wechat/css/frozen.css'/>">
  <link rel="stylesheet" type="text/css" href="<c:url value='/resource/wechat/css/main.css'/>" />
  <script src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
  <script src="<c:url value='/resource/js/jquery.form.min.js'/>"></script>
  <script src="<c:url value='/resource/wechat/js/zepto.min.js'/>"></script>
  <script src="<c:url value='/resource/wechat/js/frozen.js'/>"></script>

</head>
<body class="bg_fff" ontouchstart>
<%--<header class="ui-header ui-header-positive ui-border-b">
  <i class="ui-icon-return" onclick="history.back()"></i>
  <h1>我的线索举报详情</h1>
  &lt;%&ndash;<div class="admin_sx"><a href="#" id="sx_but">筛选</a></div>&ndash;%&gt;
</header>--%>
<section class="ui-container">
  <ul class="ul_lost">
  </ul>
  <input type="hidden" id="guid" value="${guid}">
  <input type="hidden" id="loginId" value="${loginId}">
  <input type="hidden" id="userName" value="${userName}">
  <%--<h3 class="wdbj_tit">满意度评价</h3>--%>
  <%--<ul class="ui-justify-flex ui-whitespace">--%>
    <%--<li class="test-img"> <label class="ui-radio" for="radio">--%>
      <%--<input type="radio" name="radio" checked="checked">--%>
    <%--</label> <span class="text_grey">非常满意</span></li>--%>
    <%--<li class="test-img"> <label class="ui-radio" for="radio">--%>
      <%--<input type="radio" name="radio">--%>
    <%--</label><span class="text_grey">基本满意</span></li>--%>
    <%--<li class="test-img"> <label class="ui-radio" for="radio">--%>
      <%--<input type="radio" name="radio">--%>
    <%--</label><span class="text_grey">不满意</span></li>--%>

  <%--</ul>--%>
  <%--<h3 class="wdbj_tit">评价意见</h3>--%>
  <%--<div class="ywzx_textarea">--%>
    <%--<textarea placeholder="请输入您的咨询问题，我们会尽快解答您！"></textarea>--%>
  <%--</div>--%>
  <%--<div class="ui-btn-wrap">--%>
    <%--<button class="ui-btn-lg ui-btn-primary">--%>
      <%--提交评价--%>
    <%--</button>--%>
  <%--</div>--%>
</section>
</body>

<script>

  $(function(){

    $.ajax({
      type : "get",
      url : "<c:url value='/api/matters/info/'/>" + $("#guid").val(),
      dataType : "json",
      async : false,
      success : function(resp){
        if(resp&&resp.succ){
          var _data = resp.data;
          var crtitle = _data.crtitle==null?"":_data.crtitle;
          var crtype = _data.crtype==null?"":_data.crtype;
          var crcontent = _data.crcontent==null?"":_data.crcontent;
          var contanctperson = _data.contanctperson==null?"":_data.contanctperson;
          var contanctphone = _data.contanctphone==null?"":_data.contanctphone;
          var createdatestr = _data.createdatestr==null?"":_data.createdatestr;

        //  var projectStatus_cn = changeState(_data.projectStatus_cn)==null?"":changeState(_data.projectStatus_cn);

          var _html = "<li><div class='lf80'>举报主题：</div><div class='rt_80'>"+ crtitle +"</div></li>"
                  +"<li><div class='lf80'>举报类型：</div><div class='rt_80'>" + crtype + "</div></li>"
                  +"<li><div class='lf80'>举报内容：</div><div class='rt_80'>" + crcontent+ "</div></li>"
                  +"<li><div class='lf80'>联系人：</div><div class='rt_80'>" + contanctperson+ "</div></li>"
                  +"<li><div class='lf80'>联系电话：</div><div class='rt_80'>" + contanctphone + "</div></li>"
                  +"<li><div class='lf80'>创建时间：</div><div class='rt_80'>" + createdatestr + "</div></li>";
          $(".ul_lost").html(_html);
        }
      }
    });



    $("#pingjia").click(function(){
      if($("#pjnr").val() == ""){
        alert("请输入评价内容");
        return;
      }
      var grade;
      $("input[type='radio']").each(function(){
        if(this.checked == true){
          grade = this.value;
        }
      })
      $.ajax({
        type : "post",
        data : '{"evaluationGrade":"' + grade + '","createUserName":"' + $("#userName").val() + '","evaluationContent":"' + $("#pjnr").val() + '","createUserId":"' + $("#loginId").val() + '","evaluaTionType":"2","prjGuid":"' + $("#prjguid").val() + '"}',
        url : "<c:url value='/api/matters/product/myd'/>",
        dataType : "json",
        contentType : "application/json;charset=utf-8",
        success : function(resp){
          if(resp&&resp.succ){
            alert(resp.msg);
            window.location.href = "<c:url value='/weixin/transact/index'/>";
          }else {
            alert(resp.msg);
          }
        }
      });
    });


  });

  function changeState(state){
    if(state == "提交"){
      return "待预审";
    }else if(state == "处理中"){
      return "办理中";
    }
    return state;
  }


</script>

</html>